package control
{
	import com.adobe.cairngorm.control.FrontController;
	
	import command.DeletePlaceCommand;
	import command.DeleteTripCommand;
	import command.FetchTripsCommand;
	import command.GetMyPicturesCommand;
	import command.GetPlaceComments;
	import command.LoginCommand;
	import command.RegisterCommand;
	import command.SaveCommentCommand;
	import command.SaveTripCommand;
	import command.SearchForTrips;
	import command.UpdateProfileCommand;
	import command.webServices.GetEventfulCommand;
	import command.webServices.GetFlickerCommand;
	import command.webServices.GetHotwireCommand;
	import command.webServices.GetWeatherCommand;
	
	import event.LoginRequest;
	import event.QuestionRequest;
	import event.TripManagerEvent;
	import event.WebServiceEvent;

	
	public class Controller extends FrontController
	{
		public function Controller()
		{
			super();
			addCommand(LoginRequest.LOGIN, LoginCommand);

			
			/**************************
			 *   web services
			 **************************/  
			addCommand(WebServiceEvent.WEATHER, GetWeatherCommand);
			addCommand(WebServiceEvent.EVENTFUL, GetEventfulCommand);
			addCommand(WebServiceEvent.HOTWIRE, GetHotwireCommand);
			addCommand(WebServiceEvent.FLICKR, GetFlickerCommand);
			/**************************
			 *    User handlers
			 **************************/  
			addCommand(LoginRequest.REGISTER, RegisterCommand);
			addCommand(LoginRequest.UPDATE, UpdateProfileCommand);

			addCommand(TripManagerEvent.SAVE_TRIP, SaveTripCommand);
			addCommand(TripManagerEvent.FETCH_ALL_TRIPS, FetchTripsCommand);
			addCommand(TripManagerEvent.DELETE_TRIP, DeleteTripCommand);
			addCommand(TripManagerEvent.SEARCH_TRIP, SearchForTrips);

			// palce handlers
			addCommand(TripManagerEvent.DELETE_PLACE, DeletePlaceCommand);
			addCommand(TripManagerEvent.GET_PLACE_COMMENTS, GetPlaceComments);
			addCommand(TripManagerEvent.SAVE_COMMENT, SaveCommentCommand);
			

			addCommand(TripManagerEvent.GET_MY_PICTURES, GetMyPicturesCommand);

		}
	}
}